# -*- coding: utf-8 -*-
import logging
"""
ERROR_DEBUG =0
ERROR_INFO  =1
ERROR_WARNING   =2
ERROR_ERROR =3
ERROR_CRITICAL  =4
"""

class Error(Exception):
    code    =0
    msg =None
    note    =None
    level   =None
    name    =""
    
    def __init__(self,note="empty"):
        Exception.__init__(self)
        self.set_note(note)
        
    def set_note(self,note):
        self.note=note
    def get_note(self):
        return self.note


    def __str__(self):
        return "    -    CODE:%d MSG:%s NOTE:%s \n"%(self.code,self.msg,self.note)
    
    def log(self):
        if(self.level   ==  logging.DEBUG):
            logging.debug(self.__str__())

        if(self.level   ==  logging.INFO):
            logging.info(self.__str__())
            
        if(self.level   ==  logging.WARNING):
            logging.warning(self.__str__())
        
        if(self.level   ==  logging.ERROR):
            logging.error(self.__str__())
        
        if(self.level   ==  logging.CRITICAL):
            logging.critical(self.__str__())
        
def main():
    e=Error()
    print e.__class__       

if __name__ == "__main__":      
    main()
        

    